Abbreviate verbose clickhouse logs.#10443
Open
jmcarp wants to merge 1 commit into
Open
Conversation
As of this writing, `system.query_log` is one of the largest clickhouse tables. From dogfood: ``` ┌─database─┬─table──────────────────────────┬─compressed─┬─uncompressed─┬───────rows─┐ │ system │ query_log │ 17.11 GiB │ 39.49 GiB │ 24942352 │ │ oximeter │ measurements_cumulativeu64 │ 15.52 GiB │ 91.91 GiB │ 1576299396 │ │ oximeter │ measurements_f32 │ 14.52 GiB │ 85.23 GiB │ 1849126423 │ │ oximeter │ measurements_histogramu64 │ 2.76 GiB │ 117.37 GiB │ 78425393 │ │ system │ metric_log │ 742.29 MiB │ 12.84 GiB │ 2543307 │ └──────────┴────────────────────────────────┴────────────┴──────────────┴────────────┘ ``` Most of this table's disk use is attributable to the `query` column, and most of that usage comes from the very long measurement queries run by oximeter, which take the form of: ``` SELECT * FROM oximeter.measurements_* WHERE timeseries_key IN (...) ``` The `IN` clause can include thousands of keys, and a single oximeter query can run multiple clickhouse queries of this form. This takes up a lot of space in the query log. This patch truncates long `IN (...)` clauses. These aren't operationally useful, and shortening them shrinks `system.query_log` by about 80% in testing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As of this writing,
system.query_logis one of the largest clickhouse tables. From dogfood:Most of this table's disk use is attributable to the
querycolumn, and most of that usage comes from the very long measurement queries run by oximeter, which take the form of:The
INclause can include thousands of keys, and a single oximeter query can run multiple clickhouse queries of this form. This takes up a lot of space in the query log.This patch truncates long
IN (...)clauses. These aren't operationally useful, and shortening them shrinkssystem.query_logby about 80% in testing.